<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    function Person(name = "张三", age = 20) {
        this.name = name;
        this.age = age;
        this.hubby = ["java", "c++"];
    }

    Person.prototype.say = function() {
        console.log(this.name);
    }

    function Student(name, age, score) {
        // this.name = name;
        // this.age = age;
        this.score = score;
    }

    Student.prototype = new Person();
    let s1 = new Student("s1", 10, 100);
    console.log(s1);
    console.log(s1.age);
    console.log(s1.name);
    s1.hubby.push("mysql");
    s1.say();
    let s2 = new Student("s1", 10, 100);
    console.log(s2);

    function Teacher(name, age, major) {
        // this.name = name;
        // this.age = age;
        this.major = major;
    }

    function Work(name, age, salary) {
        // this.name = name;
        // this.age = age;
        this.salary = salary;
    }

</script>
</body>
</html>